﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Moving03.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="padding_left_30px">
    <h1>
        ĐĂNG KÝ</h1>
    <p>
        &nbsp;</p>
    <p>
        <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#EFF3FB" 
            BorderColor="#B5C7DE" BorderStyle="Solid" BorderWidth="1px" 
            Font-Names="Verdana" Font-Size="1em" style="margin-top: 0px" Width="523px" 
            ForeColor="Black" DisplayCancelButton="True" 
            ContinueDestinationPageUrl="./Default.aspx" 
            CreateUserButtonText="Next step" 
            oncreateduser="CreateUserWizard1_CreatedUser" 
            onfinishbuttonclick="CreateUserWizard1_FinishButtonClick" 
            oncontinuebuttonclick="CreateUserWizard1_ContinueButtonClick" 
            onnextbuttonclick="CreateUserWizard1_NextButtonClick">
            <ContinueButtonStyle BackColor="White" BorderColor="#507CD1" 
                BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" 
                ForeColor="#284E98" />
            <CreateUserButtonStyle BackColor="White" BorderColor="#507CD1" 
                BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" 
                ForeColor="#284E98" />
            <TitleTextStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                 <ContentTemplate>
                    <table>
                        <tr>
                            <th>User Information</th>
                        </tr>
                        <tr>
                            <td>Username:</td>
                            <td>
                                <asp:TextBox runat="server" ID="UserName" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator9" ControlToValidate="UserName" 
                                    ErrorMessage="Username is required." />
                            </td>
                        </tr>
                        <tr>
                            <td>Password:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Password" TextMode="Password" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator10" ControlToValidate="Password" 
                                    ErrorMessage="Password is required." />
                            </td>
                        </tr>
                        <tr>
                            <td>Confirm Password:</td>
                            <td>
                                <asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator13" ControlToValidate="ConfirmPassword" 
                                    ErrorMessage="Confirm Password is required." />
                            </td>
                        </tr>
                        <tr>
                            <td>Email:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Email" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator11" ControlToValidate="Email" 
                                    ErrorMessage="Email is required." />
                            </td>
                        </tr>
                        <tr>
                            <td>Question:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Question" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator12" ControlToValidate="Question" 
                                    ErrorMessage="Question is required." />
                            </td>
                        </tr>
                        <tr>
                            <td>Answer:</td>
                            <td>
                                <asp:TextBox runat="server" ID="Answer" />
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator14" ControlToValidate="Answer" 
                                    ErrorMessage="Answer is required." />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                 <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Literal ID="Literal1" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                    </table>

                      

                      </ContentTemplate>
                </asp:CreateUserWizardStep>

                <asp:WizardStep ID="CreateUserWizardStep2" runat="server">
                    <table style="font-family:Verdana;font-size:100%;width:497px;">
                        <tr>
                            <td align="center" colspan="2" 
                                style="color:White;background-color:#507CD1;font-weight:bold;">
                                Sign Up for Your New Account</td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="UserNameLabel" runat="server" >Chức danh:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="ChucDanh" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label2" runat="server">Tên công ty:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="TenCongTy" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Họ Tên</td>
                            <td>
                                <asp:TextBox ID="hoten" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label3" runat="server">Quốc gia:</asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlQuocGia" runat="server" Height="29px" Width="126px" 
                                    DataSourceID="LinqDataSource1" DataTextField="TenQuocGia" 
                                    DataValueField="Id_MaQGia">
                                    <asp:ListItem>Việt Nam</asp:ListItem>
                                    <asp:ListItem>English</asp:ListItem>
                                </asp:DropDownList>
                                <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                                    ContextTypeName="Moving03.DataClasses1DataContext" EntityTypeName="" 
                                    Select="new (Id_MaQGia, TenQuocGia)" TableName="DanhSachQuocGias">
                                </asp:LinqDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label4" runat="server">Địa chỉ 1:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="DiaChi1" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label5" runat="server">Địa chỉ 2:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="DiaChi2" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label6" runat="server">Thành phố:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="ThanhPho" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label7" runat="server">Mã bưu điện:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="MaBuuDien" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label8" runat="server">Điện thoại:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="DienThoai" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="Label9" runat="server">Loại hình đăng ký:</asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlLoaiDangKy" runat="server" Height="30px" Width="125px">
                                    <asp:ListItem>Cá nhân</asp:ListItem>
                                    <asp:ListItem>Doanh Nghiệp</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="AnswerLabel4" runat="server">Ưu tiên liên lạc:</asp:Label>
                            </td>
                            <td>
                                <fieldset style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; font-family: Arial, sans-serif; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(235, 235, 230); ">
                                </fieldset></td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2" style="color:Red;">
                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                    </table>

                    
                   <asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>"
                        UpdateCommand="UPDATE [aspnet_Users] SET [ChucDanh] = @ChucDanh,[HoTen]=@hoten, [TenCongTy] = @TenCongTy, [DiaChi1] = @DiaChi1, [DiaChi2] = @DiaChi2, [ThanhPho] = @ThanhPho, [MaBuuDien] = @MaBuuDien, [DienThoai] = @DienThoai,[QuocGia]=@ddlQuocGia,[Email]=@Email WHERE [UserName] = @Username"
                        
                        ProviderName="<%$ ConnectionStrings:UPSConnectionString.ProviderName %>">
                        <UpdateParameters>
                            <asp:ControlParameter Name="ChucDanh" Type="String" ControlID="ChucDanh" PropertyName="Text" />
                            <asp:ControlParameter Name="TenCongTy" Type="String" ControlID="TenCongTy" PropertyName="Text" />
                            <asp:ControlParameter Name="hoten" Type="String" ControlID="hoten" PropertyName="Text" />
                            <asp:ControlParameter Name="DiaChi1" Type="String" ControlID="DiaChi1" PropertyName="Text" />
                            <asp:ControlParameter Name="DiaChi2" Type="String" ControlID="DiaChi2" PropertyName="Text" />
                            <asp:ControlParameter Name="ThanhPho" Type="String" ControlID="ThanhPho" PropertyName="Text" />
                            <asp:ControlParameter Name="MaBuuDien" Type="String" ControlID="MaBuuDien" PropertyName="Text" />
                            <asp:ControlParameter Name="DienThoai" Type="String" ControlID="DienThoai" PropertyName="Text" />                            
                            <asp:ControlParameter Name="ddlQuocGia" Type="String" ControlID="ddlQuocGia" PropertyName="SelectedValue" />
                        </UpdateParameters>
                       
                    </asp:SqlDataSource>

               </asp:WizardStep>

                <asp:CompleteWizardStep runat="server" />
            </WizardSteps>
            <HeaderStyle BackColor="#284E98" BorderColor="#EFF3FB" BorderStyle="Solid" 
                BorderWidth="2px" Font-Bold="True" Font-Size="0.9em" ForeColor="White" 
                HorizontalAlign="Center" />
            <NavigationButtonStyle BackColor="White" BorderColor="#507CD1" 
                BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" 
                ForeColor="#284E98" />
            <SideBarButtonStyle BackColor="#507CD1" Font-Names="Verdana" 
                ForeColor="White" />
            <SideBarStyle BackColor="#507CD1" Font-Size="0.9em" VerticalAlign="Top" />
            <StepStyle Font-Size="0.8em" />
        </asp:CreateUserWizard>
    </p>
    </div>
</asp:Content>
